#include "barchartview.h"
#include "ui_barchartview.h"

BarChartView::BarChartView(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::BarChartView)
{
    ui->setupUi(this);


    QMap<QString, long long> hanmeimeiScores;

    hanmeimeiScores.insert(TM, 98);
    scores.insert(HANMEIMEI, hanmeimeiScores);

    QMap<QString, long long> lileiScores;
    lileiScores.insert(TM, 78);
    scores.insert(LILEI, lileiScores);

    QMap<QString, long long> polyScores;
    polyScores.insert(TM, 95);
    scores.insert(POLY, polyScores);


    QStringList labels;
    labels << TM;

    ui->widget->setTitle(QString::fromLocal8Bit("Title"));
    ui->widget->setYLabel(QString::fromLocal8Bit("Count"));
    ui->widget->setOrientation(ChartPane::VERTICAL_BAR);
    ui->widget->setLabels(labels);

 
}

BarChartView::~BarChartView()
{
    delete ui;
}

void BarChartView::setData(QMap<QString, QMap<QString, long long> > mapData)
{
    // 数据传入图表
 /*   ui->widget->setData(mapData);
    ui->widget->drawBar();*/

    ui->widget->drawLine();
}
